package com.itheima.dao;

import com.itheima.domain.Person;
import org.apache.ibatis.annotations.*;

import java.util.List;

@Mapper
public interface PersonDao {
    @Select("select * from person_table where id = #{id}")
    public Person getById(int id);

    @Update("update person_table set name= #{name},age= #{age} where id= #{id}")
    public int update(Person person);

    @Insert("insert into person_table (id,name,age) values (#{id},#{name},#{age})")
    public int insert(Person person);

    @Delete("delete from person_table where id= #{id}")
    public int delete(int id);

    @Select("select * from person_table")
    public List<Person> getAll();

}
